{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import sys\n",
    "import warnings\n",
    "from pyecharts.charts import HeatMap\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签\n",
    "plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import HeatMap\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "value = [[i, j, random.randint(0, 50)] for i in range(24) for j in range(7)]\n",
    "c = (\n",
    "    HeatMap()\n",
    "    .add_xaxis(Faker.clock)\n",
    "    .add_yaxis(\"series0\", Faker.week, value)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"HeatMap-基本示例\"),\n",
    "        visualmap_opts=opts.VisualMapOpts(),\n",
    "    )\n",
    "    .render(\"heatmap_base.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
